/**
 * Created by wash on 16/8/3.
 */
'use strict'

// 引入组件！直接使用es6的语法
import main from './views/main.vue';
import paasMysql from './views/paasMysql.vue';
import paasRedis from './views/paasRedis.vue';
import mysqlDetail from './views/mysqlDetail.vue';
import basicInfo from './views/basicInfo.vue';
import accountManage from './views/accountManage.vue';
import monitorAlarm from './views/monitorAlarm.vue';
import recovery from './views/recovery.vue';
import books from './views/books.vue';
import createInstance from './views/createInstance.vue';
import jstree from './views/jstree.vue';
import fileUpload from './views/fileUpload.vue';
import uiSortable from './views/uiSortable.vue';


// 每条路由规则应该映射到一个组件。这里的“组件”可以是一个使用 Vue.extend创建的组件构造函数，也可以是一个组件选项对象。
// 稍后我们会讲解嵌套路由
export default function(router) {

    router.map({//定义路由映射
        '/paas': {//访问地址
            name: 'paas',//定义路由的名字。方便使用。
            component: main,//引用的组件名称，对应上面使用`import`导入的组件
            //component:require("components/app.vue")//还可以直接使用这样的方式也是没问题的。不过会没有import集中引入那么直观
            subRoutes: {
                '/mysql':{
                    name:'mysql',
                    component:paasMysql
                },
                '/redis':{
                    name:'redis',
                    component:paasRedis
                },
                '/createInstance':{
                    name:'createInstance',
                    component:createInstance
                },
                '/mysqlDetail/:mysqlName':{
                    name:'mysqlDetail',
                    component:mysqlDetail,
                    subRoutes: {
                        'basicInfo':{
                            name:'basicInfo',
                            component:basicInfo
                        },
                        'accountManage':{
                            name:'accountManage',
                            component:accountManage
                        },
                        'monitorAlarm':{
                            name:'monitorAlarm',
                            component:monitorAlarm
                        },
                        'recovery':{
                            name:'recovery',
                            component:recovery
                        }
                    }
                },
                '/books':{
                    name:'books',
                    component:books
                },
                '/jstree':{
                    name:'jstree',
                    component:jstree
                },
                'fileUpload':{
                    name:'fileUpload',
                    component:fileUpload
                },
                'uiSortable':{
                    name:'uiSortable',
                    component:uiSortable
                }
            }
        }
    })

}
